package net.wanho.controller;

import lombok.RequiredArgsConstructor;
import net.wanho.dto.OutStoreDTO;
import net.wanho.po.OutStore;
import net.wanho.service.OutStoreService;
import net.wanho.vo.AjaxResult;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@RequestMapping("/outstore")
public class OutStoreController {
    private final OutStoreService outStoreService;

    @GetMapping("/outstore-page-list")
    public AjaxResult outstorePageList(@RequestParam(defaultValue = "1") Integer pageNum,
                                       @RequestParam(defaultValue = "5") Integer pageSize,
                                       OutStoreDTO outStoreDTO) {
        return AjaxResult.success(outStoreService.outstorePageList( pageNum, pageSize, outStoreDTO));
    }


    @PutMapping("/outstore-confirm")
    public AjaxResult outstoreConfirm(@RequestBody OutStore outStore) {
        outStoreService.outstoreConfirm(outStore);
        return AjaxResult.success("出库成功！");
    }
}
